import axios from 'axios';

// http://192.168.88.177/api/api-user/user/org/osUser/getLoginUserAndMenu
export const getLoginUserAndMenu = async () => {
  const token = localStorage.getItem('authorization');
  const url = '/datarequest/api/api-user/user/org/osUser/getLoginUserAndMenu';
  const result = await axios.get(url, {
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'authorization': 'Bearer ' + token
    },
  })
  return result.data;
}

// http://192.168.88.177/api/api-user/user/org/osUser/getByld?userld
export const getUserInfoByID = async (userId) => {
  const token = localStorage.getItem('authorization');
  const url = '/datarequest/api/api-user/user/org/osUser/getById?userId=' + userId;
  const result = await axios.get(url, {
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'authorization': 'Bearer ' + token
    },
  })
  return result.data;
}
